<script setup lang="ts">
  import { ref } from 'vue'

  // 是否正在倒计时
  const isCoundown = ref(false)

  // 测试获取验证码
  async function getCode() {}
</script>

<template>
  <uni-forms ref="form" class="login-form">
    <uni-forms-item name="">
      <uni-easyinput
        :input-border="false"
        :clearable="false"
        placeholder="请输入手机号"
        placeholder-style="color: #C3C3C5"
      />
    </uni-forms-item>
    <uni-forms-item name="">
      <uni-easyinput
        type="text"
        placeholder="请输入验证码"
        :input-border="false"
        :clearable="false"
      />
      <text class="text-code" @click="isCoundown = true" v-if="isCoundown === false"
        >获取验证码</text
      >
      <!-- 倒计时组件 -->
      <view class="text-code" v-else>
        <uni-countdown
          :show-day="false"
          :showHour="false"
          :showMinute="false"
          :second="5"
          @timeup="isCoundown = false"
        ></uni-countdown
        >s
      </view>
    </uni-forms-item>
    <view class="login">
      <button type="primary" style="border-radius: 50px; background-color: #fe6a3d">登录</button>
    </view>
  </uni-forms>
</template>

<style lang="scss">
  @import './style.scss';
</style>
